package com.sat.pay.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：支付宝支付基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000121625148";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCWxqcK5qdVfWaNNbqgQStf5Qq9FnQye9YuvH/AJYw2OOAJJoKZcn4oI6IMP8+wz++RmwRL8OEZ8ac+UABswUz0pC9LVi+rrGYAU4zhkr36/6RDa/dTfvCrDcNhamXRBjAUdzFyL2gzhxHw0MDMU2Gbq3JJ/OZwVrUu5QdtbPu5RXkKVJYqqu97umj8/NzUkp9kzS670eUO9esKekTRtL2zCQpK4Z6hYXnA6fAx2nr29XrEwVabCOZQL1QUVeg3AIOjopoJuFrz4ed0eT2EhKg0djx7oXMWpyWlQQPYw/CmqicLzcvuFNqbIyysHyRSDl+oUD1suhHbZjdB6BuQLrP9AgMBAAECggEAfdgYnDSf/e7IpZvuxMsgFM3rBJ+1JF3QCvox9oJgYPFfrMODxeeV/JKhMnAgPYeQgYtNLsVCXJEh8hR8BkngnWBcSRkKeNNP333c3HnKL7EnvU5kBECzR1IZfTl8+dWcU7iYgKGo6zkVdFYIVYJSuceDgNWg0KrOVvG6HU8VWzClNOD41zhps/0YdEVRAC2FfTO3k79kl5/UvacR/AX2WTfswBytaUwjfHLe6s5F0uz6kQUQPHPdRapIylXzCtIiiBTy4pmKD/5zPYvDKUZ+hT6rtlrQf1fihHtHgNDk73OMcfQIXSJ1PsDTj1j5NU+H0eDbxA+dNLbT9lM7gbnKgQKBgQDHCyTdVUwvbV+DcyHuOSAj1SEPspj+4d217KnHsYLrJ7TnN6wEVsyhomunc+gabR9UiWWvTVMqvFPPCAH1ZTuayAn24Swk857avKWNgHE9AfO60hKUoDJtfL77QOolWogvE6UKVpiSkDh1vGBwgSK6+M6Nw0AtXo+SV8lVgtKkuQKBgQDB67A6kG+me3Zp1BKoCx7jhV7b44sKzDJDsU/+j+YbQfjPafPZk01w/Hx4o604rWRXecEmKfQjWw/sz9RwKrj1sIX1lgDV0+R1qf9Nct+e4p/uKQzX3PKfk6eMkh7YWASPPbPuRYiWllrIO7WaC9k3nVN1ROUZA+e7j4lW9iPvZQKBgDkRQuKKoCtA6o+fpOzOSB697pq3lBIP5CdS0WLFzElruvxIA/PChy0YilEadEOPYdo1Aoh+XQf1svm6zAT1n19DV0gHS0bU6ojAaZ7mYpEhTCYWMOmX/J1TlNYoyHkpOb51nW4XYeszmlx3RBc9jx2YVHBkuLPJVtSYgssXlRlRAoGALtiZAgzSbA13Val9uEq3c49MkyIs/LbHjcLP6Fcq53rQeIrH9c+37YuRJjOkLQT2MIuhNW79I21kM3khgNdRR0kVk3ZhTUaa8jHXEwalLuTgbdBM4fjmQ9aPq03BVdIth80IIo95p6c61xRVkpk6KE1BVBsInTpsSMssCm370GECgYBiJZto4E87U6HHPSFcnfOVcqGE+8ohsWtAenC60wbspVDPa5gI8H2FA5fu2PmEYtY8vaTKf2z3TAMe9CqhqCpUV5+R2LOwvF5P5BFBcxh4fU3aqfmCOCwEMXTqA6TdEWWCUEuADbOe1RA/bAuKTovWSbToqI50Fqx6xGxrMUNE1Q==";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAplgr+imfEd2z8UQDq6O3SoBYbTze4LG2so4KNT38bTgC9Y+sEvlA7oODLY8HMit18pwI68Up9wJXqWS3gU+yimxLATxa4YKA3davOLK9qWdoFaXofE7p7vVvKdiN/WrBDchbhj1byR9IszykwB0gJh1Orr5laYVvY3WI8X/ZIvo/tcwcWZ8Po+muOY0RhpJNqrZlbMOg8ZuONoeLTsUR6KDsZ1fj8RIm0Zn010TITC3BrCFP9z2/Jn3q7ywFP+KPJk2IZM3X9ENh7YLFJnr3OGIRU7ohU2XEEZyKjjpZtU0ujw4fVrP7XACWb9HsSYVAcelxW8HicUhvnybYVbgXQQIDAQAB";
	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "https://qq18307096730.gnway.cc:5353/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "https" +
            "://qq18307096730.gnway.cc:5353/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

